package com.tdu.cn.file;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/*
 * 用来测试引入外部文件
 */
@Component
@PropertySource("classpath:application.properties")
public class Database {
    //如果导入不成功则执行@Value("${name}")
    @Value("${spring.datasource.url}")
    private String name;

    @Value("${spring.datasource.username}")
    private String path;

    @Value("${spring.datasource.password}")
    private String size;

    @Override
    public String toString() {
        return "Database [name=" + name + ", path=" + path + ", size=" + size + "]";
    }
    
}

